package com.yanqu.road.entity.activity.zhounianturntable;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@FieldTypeAnnotation(tableName = "t_u_activity_zhounian_turntable_data")
public class ZhouNianTurntableData extends DataObject {

    @FieldTypeAnnotation(update = true, desc = "角色id")
    private long userId;

    @FieldTypeAnnotation(select = true, update = true, desc = "活动id")
    private int activityId;

    @FieldTypeAnnotation(desc = "格子数据")
    private List<ZhouNianTurntableItem> items = new ArrayList<>();

    // "1,0" => 1 , "2,0" => 2  档次和索引为key , 次数为索引
    @FieldTypeAnnotation(desc = "已选信息")
    private Map<String, Integer> chooseInfoMap = new ConcurrentHashMap<>();

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if(this.userId != userId) {
            this.userId = userId;
            setUpdateOption();
        }
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if(this.activityId != activityId) {
            this.activityId = activityId;
            setUpdateOption();
        }
    }

    public List<ZhouNianTurntableItem> getItems() {
        return items;
    }

    public void setItems(List<ZhouNianTurntableItem> items) {
        this.items = items;
        setUpdateOption();
    }

    public Map<String, Integer> getChooseInfoMap() {
        return chooseInfoMap;
    }

    public void setChooseInfoMap(Map<String, Integer> chooseInfoMap) {
        this.chooseInfoMap = chooseInfoMap;
        setUpdateOption();
    }
}
